#include "commandparser.h"

QString CommandParser::command = "";
CommandParser::CommandParser()
{

}

QString CommandParser::sendDataToSlaveCmd(QString type, QString val)
{
    QString cmd = QString("{%1[%2]}").arg(type).arg(val);
    return cmd;
}

QString CommandParser::readDataFromSlaveCmd()
{
    command = "OPT[D]";
    return command;
}

QString CommandParser::readPIDFromSlaveCmd()
{
    command = "OPT[A]";
    return command;
}

QString CommandParser::saveParamsSlaveCmdA()
{
    command = "SAV[A]";
    return command;
}

QString CommandParser::saveParamsSlaveCmdC()
{
    command = "SAV[C]";
    return command;
}

QString CommandParser::saveTestPowerZero()
{
    command = "SAV[L]";
    return command;
}

QString CommandParser::sendOpenSpeedCmd(const float &value)
{
    QString strValue = QString("%1").arg(value);
    return sendDataToSlaveCmd("00", strValue);
}

